home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / misc / worldmap / mapvu20 / mapview.doc < prev    next >
Encoding:
Text File  |  1989-01-11  |  46.3 KB  |  938 lines

  1.  
  2.                           M A P V I E W  2.0
  3.  
  4.                     Gisbert W. Selke, 11 Jan 1989
  5.  
  6.  
  7. MapView is an interactive programme  for drawing maps in a  variety of
  8. projections.   It reads  data from  files in  a number  of formats and
  9. displays them on  all display adapters  supported by TurboPascal  5.0,
  10. the language  it was  written in.   It  should run  on all IBM PCs and
  11. clones on  which TurboPascal's  Graph unit  runs.   As distributed, it
  12. makes no use of a coprocessor,  but it can easily be recompiled  to do
  13. so.  It  makes nearly no  sense to use  this programme without  a hard
  14. disk.  A  hardcopy facility is  built in which  is designed for  Epson
  15. type  dot  matrix  printers.    Also  supplied  are  two programmes to
  16. preprocess  data  (Mp1ToMpx,  TrigCalc)  and  two  to  view previously
  17. generated pictures (Slide/QSlide).  Full sources to all the programmes
  18. are supplied.   -  Map data  files have  to be acquired independently;
  19. MapView  has  no  built-in  data  whatsoever.    The  map files it was
  20. designed  to  work  with  have  been  produced by John Allison and can
  21. probably gotten at the same place (bulletin board etc.) as MapView.
  22.  
  23.  
  24. (i) Quick start
  25. ---------------
  26.  
  27. This  tells  you  how  to  get  started  as fast as possible.  All the
  28. refinements, structuring, and  so forth, will  be discussed later.   -
  29. So, first, put all the MapView-related files into one subdirectory for
  30. now (you may omit  the PAS and TPU  files); put all the  MP1 files you
  31. must have received  independently there, too.   Start up  MapView from
  32. the DOS  prompt; after  marvelling at  the logo,  hit "X", followed by
  33. "ECL" when prompted  (always without the  quotes, to be  sure; case is
  34. insignificant, by  the way).   Don't  be bothered  by a message saying
  35. that some file E0.LST can't be found - MapView is just showing off its
  36. ability to find even things that  are not there.  Hopefully, you  will
  37. now watch  a map  of Europe  (continental outlines  only) being drawn.
  38. (Later you will learn how to make drawing much faster.)  Now type  "W"
  39. - you  will see  a pair  of crosshairs,  which you  can move  with the
  40. cursor keys; the upper left corner of the screen will always tell  you
  41. where you are.   When you're  tired of it,  hit the <ENTER>  key.  Now
  42. type "X" again, then "EN".  You will have a different kind of map now,
  43. and this time  it will be  Europe along with  its islands, lakes,  and
  44. political boundaries.  When drawing has finished, type "Z" to zoom in;
  45. first use  the cursor  keys to  designate the  South-West corner,  hit
  46. <ENTER>,  then  designate  the  North-East  corner, hit <ENTER> again.
  47. Nothing will happen.  But then, hit "E" to erase the screen, then  "D"
  48. to redraw - now you'll get the  part you picked.  Hit "X" again,  then
  49. "WORLD0".   Now you'll  get a  view of  the Earth  as seen  from outer
  50. space; this will take some time to do.  When you're ready to  proceed,
  51. hit "S":  you  have just created a  picture file on disk.   Experiment
  52. some  more;  get  help  with  "?",  display  settings with "M",... and
  53. finally,  hit  "Q"  to  quit.    You're  not through, yet - at the DOS
  54. prompt, type "SLIDE SCREEN  /R0".  In an  instant, the world map  will
  55. pop up on the  screen.  If you  have typed "S" more  often during your
  56. first session, all the pictures you saved will be shown in an  endless
  57. slide show.  Hit any key to finish.  (You might also try the same with
  58. QSlide, if you have a CGA or a Hercules.)  You're done for now!
  59.  
  60.  
  61. (ii) Setup
  62. ----------
  63.  
  64. You will need  at least MAPVIEW.EXE  and a couple  of map files  (with
  65. extensions .MP3, .MP2, .MP0, or .MP1, see (vii) below); also, you will
  66. need the Borland  BGI driver applicable  to your display  adapter.  If
  67. you want  the simple  on-line help  screen to  be available,  you need
  68. MAPVIEW.HLP.    In  addition,  you  may  want  to  have MAPVIEW.CNF (a
  69. configuration file  in plain  text format,  see (v)  below), SLIDE.EXE
  70. and/or QSLIDE.EXE to  view previously generated  pictures as a  'slide
  71. show', and a variety of list files (extension .LST) and command  files
  72. (extension .CMD).  For the generation of .MP2 or .MP0 files, you  will
  73. also  need  MP1TOMPX.EXE.    TRIGCALC.EXE  will  prepare  a  file with
  74. precomputed  trigonometric  values  for  fastest  execution;  this  is
  75. especially useful with MP0 or MP1 files but also speeds up use of  MP2
  76. and MP3 files somewhat.
  77.  
  78. I suggest you create a  directory WORLDMAP to hold the  executables, a
  79. subdirectory each for the command and list files (and possibly one for
  80. the picture  files you  will generate),  and group  the map files into
  81. subdirectories according to continents, say, EUROPE, AUSTRALI, and  so
  82. forth.   This is  for your  convenience only,  though; MapView doesn't
  83. make  any  assumptions  on   your  directory  structure  except   that
  84. MAPVIEW.CNF, if  present, MAPVIEW.HLP,  and the  BGI driver  be in the
  85. current directory  (or accessible  via APPEND  or the  like).   If you
  86. create subdirectories, you should  set up MAPVIEW.CNF to  reflect your
  87. choices; you can  set a few  other esoteric things  in this file,  too
  88. (see (v) below).  If you  want to pre-process the map files  either to
  89. save disk space or to make  execution much faster - which I  recommend
  90. -, put all the  map files into one  directory, then use Mp1ToMpx  (see
  91. (vii)  below);  move  the  resulting  MP0,  MP2  or MP3 files into the
  92. appropriate subdirectories, finally deleting the raw MP1 files.   (You
  93. do have a  back-up copy, don't  you?).  Finally,  run TrigCalc if  you
  94. have some 108KB to spare; see  the note on timings (appendix C  below)
  95. to decide if the  speed gain is worth  the disk space expenditure.   -
  96. Now you may remove MP1TOMPX.EXE and TRIGCALC.EXE.
  97.  
  98. Nearly all  of this  can be  automated by  using the  two batch  files
  99. supplied, INSTMVU.BAT  and INSTMAP.BAT,  which will  set up everything
  100. for use with  the configuration file  provided.  Copy  all the MapView
  101. files and all  the map files  into a directory  of your choosing,  say
  102. WORLDMAP.     Then  type   "INSTMVU":     this  will   create  several
  103. subdirectories for use  by MapView and  move the appropriate  files to
  104. their places.  Then  type "INSTMAP 2" (or  "INSTMAP 3" if you  have an
  105. 80x87 coprocessor and  are willing to  recompile MapView):   this will
  106. preprocess all the map files  for fastest MapView operation and  place
  107. them in subdirectories of their own.  Alternatively, type "INSTMAP  0"
  108. if  your  disk  space  is  scarce,  or  "INSTMAP  1",  which  will not
  109. preprocess files but just  move them into the  various subdirectories.
  110. - Note:  before you start InstMap, make sure you have backup copies of
  111. the map data files  as you received them  - InstMap will delete  these
  112. files after preprocessing them!  - InstMap will take some time to  run
  113. (about 45 minutes on  my 10MHz AT clone  if used with the  "2" option;
  114. much  less  with  the  "0"  option,  and  nearly  no time with the "1"
  115. option).
  116.  
  117.  
  118. (iii) MapView operation
  119. -----------------------
  120.  
  121. Start MapView by typing 'MAPVIEW' at the DOS prompt.  It will  display
  122. its default start-up screen and show a prompt in the upper row of  the
  123. graphics screen.  If ever you forget what the cryptic letters up there
  124. mean, type  "?" to  get on-line  help.   Now for  the commands at your
  125. command, in an order that can get you started:
  126.  
  127. L - set file List
  128.  
  129. MapView will prompt you for the name of a file that contains the names
  130. of map  files.   The purpose  of this  is to  allow you to group files
  131. together in a meaningful way, like, say E0, E1, and E2 to get Europe's
  132. outlines,  its  islands,  and   its  lakes,  but  not   its  political
  133. boundaries.  As an option, a  list file may specify a colour  for each
  134. map which  then overrides  any colour  given by  the "C"  command (see
  135. below).  The "L" command will not draw anything - that is done by  the
  136. "D" command.  List files have,  by default, an extension of .LST;  you
  137. may  override  this,  though,  by  explicitly  providing one.  You can
  138. display a list of all available list files by replying "?" to the file
  139. name prompt.  - As  a special case, if you  want to view a single  map
  140. file, you  may also  specify this  file's name  here; if MapView can't
  141. find a list  file with the  name you give,  it will try  to find a map
  142. file with this name.  - See  (iv) below on how to prepare list  files;
  143. you'll also find  some intimation on  why, probably, the  LEV0 through
  144. LEV3 files are all you'll ever be going to need.
  145.  
  146. D - Display a map
  147.  
  148. Once you have specified a list file, you may draw the map files  given
  149. there by this command.  It uses all the parameters you have set so far
  150. (or the default ones).   The screen is  not erased initially (use  the
  151. 'E' command  for this);  this allows  you to  overlay several maps, or
  152. maybe draw the same map with various projection methods on top of each
  153. other, to study the differences.   MapView tells you with a beep  when
  154. drawing is finished -  it may take some  time...  If you  get tired in
  155. the meantime, pressing a single key will suspend drawing; pressing "Q"
  156. or "ESCape" will return you to the main MapView prompt.  (MapView will
  157. maybe not answer  your request immediately,  but it will  eventually.)
  158. If you have set a small window and have specified files that have many
  159. coordinates outside  your window,  nothing will  seem to  happen for a
  160. long time; be patient.  To keep you happy, there will be a small  sign
  161. of progress in the lower right  corner of the screen (unless you  have
  162. toggled of the prompt line).
  163.  
  164. P - set Projection method
  165.  
  166. Since the Earth is a  sphere (well, approximately) and your  screen is
  167. part of a plane (well, approximately, again), MapView will have to map
  168. the surface coordinates  into the plane.   There is  a choice of  four
  169. different projections built into MapView:
  170.  
  171. None (a misnomer, kept for historical reasons) simply treats the
  172.     latitude and longitude as the y and x coordinates, respectively.
  173. Mercator uses a non-linear scaling which preserves angles; it is best
  174.     near to the equator but distorts heavily as you approach the poles.
  175. Azimuthal here stands for an area-preserving azimuthal map, centered
  176.     on one of the poles. This is a good one for regions way North or
  177.     South. MapView chooses the pole that is best for the map window
  178.     you have set (see "Z" below).
  179. Orthogonal projection displays the Earth as seen from outer space, and
  180.     is particularly good for animated slide shows.
  181. Lambert uses a conformal conical mapping, i.e., angles are preserved
  182.     locally.  It is one of the better methods for smaller regions in
  183.     medium latitudes.
  184.  
  185. Of course, there are projection  methods galore - maybe I'll  add some
  186. more one day.  Or maybe I won't.
  187.  
  188. The latter two  methods require you  to specify a  'midpoint'; for the
  189. orthogonal  projection,  this  specifies  your  eye-point, and for the
  190. Lambert projection, the latitude given is the one at which lengths are
  191. preserved, and the longitude implicitly defines the orientation of the
  192. map.  The midpoint should, in  general, be close to the center  of the
  193. window you choose (see the "Z"  command).  You may enter these  values
  194. either  in  decimal  degrees  or  in  dd:mm:ss form.  - After startup,
  195. MapView uses Mercator projection by default.
  196.  
  197. Z - Zoom, or: set map window
  198.  
  199. If  you  want  to  view  only  part  of the world, you may specify the
  200. South-West and  the North-East  right corners  of the  window you  are
  201. interested in.   You may give  the coordinates explicitly  (in decimal
  202. degrees or in  dd:mm:ss form) in  response to the  prompt, ending each
  203. number by hitting "ENTER".  Southern latitudes and Western  longitudes
  204. are indicated by specifying a negative number.  Alternatively, if  you
  205. want to zoom in, you may  use a cursor key to activate  the crosshairs
  206. and choose the window graphically.  Movement is pixel-wise by pressing
  207. one of the four arrow keys, or 10-pixel-wise by pressing "SHIFT"  plus
  208. one of the numeric keypad arrow keys (assuming NumLock is off; on some
  209. keyboards, you may also use the  "CTRL" key instead of "SHIFT").   Hit
  210. "ENTER" when  you have  picked the  lower left  corner, then  pick the
  211. upper right  corner in  the same  fashion.   This will  not yield  the
  212. desired results if the region indicated crosses the international date
  213. line; sorry about that.
  214.  
  215. Zooming will affect future "D" commands only, not the current  screen.
  216. - Note  that some projection methods will internally restrict the area
  217. displayed, according to the characteristics of each method.
  218.  
  219. G - set Grid
  220.  
  221. By default, MapView draws a grid  in 20° intervals on every map.   The
  222. grid  width  can  be  changed  by  the  "G"  command  for latitude and
  223. longitude independently.  Specifying no number toggles grid display on
  224. or off.
  225.  
  226. W - Where are we now
  227.  
  228. This command displays  crosshairs, which can  be moved with  the arrow
  229. keys  (or  with  "SHIFT"  plus  arrow  keys  for coarse movement); the
  230. coordinates  corresponding  to  the  current  crosshairs  location are
  231. displayed in the upper left corner.  Hit "ENTER" to return to the main
  232. prompt when done.
  233.  
  234. E - Erase screen
  235.  
  236. MapView never erases the screen by itself - you have to tell it to do
  237. so.
  238.  
  239. S - Save screen to file
  240.  
  241. The screen is  copied to the  file you have  previously specified with
  242. the "N"  command (see  below), or  to the  default file of SCREEN.PIC.
  243. Pictures are always appended at the end of the file.
  244.  
  245. N - set Name of screen save file
  246.  
  247. When you type "N", you will be prompted for the name of a file to save
  248. screens to.  If you  omit the extension, the default  extension ".PIC"
  249. will be added.  If you specify no drive or path, the default directory
  250. from your configuration file, if any,  will be used.  (If you  want to
  251. override that choice and save to the current directory, start the file
  252. name with ".\".)  - MapView will check if the file already exists;  if
  253. so, it will append your saves to the  end of the file.  If not, a  new
  254. file is created.   - For an existing  file, MapView checks whether  it
  255. has a valid pic file format for the graphics adapter you are using.  -
  256. The default name for screen save files is SCREEN.PIC.
  257.  
  258. H - Hardcopy of screen to printer
  259.  
  260. The current graphics screen  is copied to the  printer via one of  the
  261. printer ports.  This assumes the printer to be similar to an Epson FX,
  262. which many printers in fact are; if yours is not, you're out of  luck,
  263. unless you adapt  the source code  (or persuade me  to do so).   - The
  264. default  port  used  is  1  (i.e.,  LPT1);  this can be changed in the
  265. configuration file (cf.  (v) below).
  266.  
  267. C - set Colour
  268.  
  269. Future drawing will  use the colour  given by this  number, except for
  270. those files  that have  a colour  associated with  them in the current
  271. list file (see (iv) below).  What colour this in fact means depends on
  272. your graphics card and settings.  You cannot specify a colour  invalid
  273. for your graphics adapter; you can specify 0 (meaning black),  though.
  274. See for yourself.
  275.  
  276. A - toggle Adaptive scaling
  277.  
  278. With projection methods None and Mercator, having adaptive scaling  on
  279. means that, whenever you zoom or specify a window, the coordinates are
  280. expanded in such a way that the  whole screen will be used.  E.g.,  if
  281. you specify a window that is very narrow (in the East-West  direction)
  282. but tall (in  the North-South direction),  then with adaptive  scaling
  283. off you will have most of the screen black; but with adaptive  scaling
  284. on, the  East and  West window  limits are  moved so  that the  entire
  285. screen is filled by the map.   This affects future "D" commands  only.
  286. It  has  no  effect  for  orthographic  and  Lambert projection modes.
  287. Adaptive scaling is off by default.
  288.  
  289. M - display Status
  290.  
  291. All the relevant settings can be  viewed with this command.  Use  this
  292. to determine your current window and projection method, or if you have
  293. forgotten what list file you specified, and so on.
  294.  
  295. <blank> - erase prompt
  296.  
  297. Hitting the space bar toggles the  prompt display on or off; use  this
  298. if you  want to  view a  map unperturbed.   While  drawing, saving  or
  299. printing, the prompt line is always off.
  300.  
  301. X - eXecute a command file
  302.  
  303. If you perform a sequence of commands often, you may want to  automate
  304. this task - this  is where command files  come in.  Simply  use a text
  305. editor  to  create  a  file  which  contains MapView commands and tell
  306. MapView to execute these commands by typing "X" at the main prompt and
  307. then giving the command file's  name.  The default extension  is .CMD;
  308. you may override this default by explixitly stating an extension.   As
  309. with the "L" command, you may display a directory of command files  by
  310. answering the file name  prompt with "?".   The bell signal that  ends
  311. the processing of list files is inactive while a command file is being
  312. executed; nice  if you  don't want  to be  disturbed while  MapView is
  313. churning away. For a different use of command files, see below.  - See
  314. (iv) below on how to prepare command files.
  315.  
  316.  
  317. ? - get on-line help
  318.  
  319. A short command line summary will be displayed.  In case you're  still
  320. confused:  "If  all else fails,  read the documentation."   (Quotation
  321. courtesy of Volker A.Brandt)
  322.  
  323.  
  324. Q - Quit
  325.  
  326. Well, you've been waiting for that, haven't you.
  327.  
  328.  
  329. MapView may  be run  fully automatic  - e.g.,  from a  batch file - by
  330. supplying the name of a command file on the DOS command line, much  as
  331. you  would  via  the  "X"  command  (but  don't specify the "X" on the
  332. command line).  Just  remember to put a  "Q" command in at  the end of
  333. the command file;  otherwise MapView will  execute the file  given and
  334. then wait for you to continue.  This feature can also come in handy to
  335. override MapView's  built-in defaults;  if you  prefer, say,  to start
  336. with a  clear screen  and in  orthographic projection  mode, create  a
  337. file (let's make it STARTUP.CMD) that contains the lines
  338.            e
  339.            p o 0 0
  340. and start MapView through 'MAPVIEW STARTUP'.
  341.  
  342.  
  343. (iv) Preparing list and command files
  344. -------------------------------------
  345.  
  346. List  files  contain  the  names  of  map  files,  one per line.  Path
  347. specifications may be included, but don't have to, if MapView can find
  348. the map  files in  the current  directory or  in one  specified in the
  349. configuration file (see (v) below).  In general, no extensions  should
  350. be given; that way, MapView will use MP3, MP2, MP0, or MP1 map  files,
  351. whichever it can find; see (vii) below.  A special command, 'END', may
  352. be used to finish  execution of a list  file before its physical  end.
  353. In addition, a colour number may be specified after each file name; if
  354. there  is  one,  this  colour  will  override any specified by the "C"
  355. command at  run-time.   (See your  system's manuals  to find out which
  356. number means which colour.)  Anything following that number is treated
  357. as a comment and is ignored.  Lines starting with a ';' are treated as
  358. comment lines.
  359.  
  360. Command  files  contain  one  command  per  line,  complete  with  all
  361. parameters  (separated  by  blanks),  and  may contain any command you
  362. could give by hand;  though it doesn't make  much sense to give  a "W"
  363. command here.  If you want to include comments in a command file,  the
  364. simplest way to  do so is  to write them  on a line  of their own that
  365. starts with a ';'.  And, yes, you may nest command files, but MapView
  366. won't keep you from shooting yourself in the foot; so you'd better not
  367. try recursion, or nesting too deeply.
  368.  
  369. Both list and command files are text files, as are configuration files
  370. (see (v) below).
  371.  
  372. One word on text files - this also applies to command and list  files:
  373. these files must be plain ASCII and should contain no embedded control
  374. sequences or tabs.   Most programme  editors are capable  of producing
  375. such files,  though not  every word  processor necessarily  does.  I'm
  376. following  a  time-honoured  practice  in  advising  you  to   specify
  377. non-document mode when using WordStar.
  378.  
  379.  
  380. (v) The configuration file
  381. --------------------------
  382.  
  383. If  you  have  a  hierarchical  file  structure, you will have to tell
  384. MapView where to find its map,  list, and command files.  Also,  a few
  385. other parameters that  may be set  for MapView can  be specified here;
  386. these things will be used only for special hardware configurations  or
  387. for particular needs; so, in general, they don't need to be  specified
  388. at all, and if they do, they won't have to (and, consequently,  can't)
  389. be changed  during execution.   To  do so,  prepare a file MAPVIEW.CNF
  390. that contains these data and put it into the current directory.   This
  391. file should contain  one information per  line:  first  a keyword that
  392. tells MapView  what kind  of datum  this is,  then the  value for this
  393. parameter, separated by one or more blanks.
  394.  
  395. The first group  contains the names  of directories to  be used.   The
  396. keywords for this are:
  397.  
  398. LST : where to find list files;
  399. CMD : where to find command files;
  400. MPX : where to find map files;
  401. PIC : where to store picture files.
  402.  
  403. Place the name  of the appropriate  directory (fully specified)  after
  404. the keyword, separated by a blank.   Note that only one directory  may
  405. be specified per line; in addition, there may be only one line each of
  406. type LST, CMD, and PIC.  There  may be many MPX lines, though -  up to
  407. 15, to be exact.
  408.  
  409. The  second  group  is  mainly  concerned  with  peculiarities of your
  410. graphics equipment and your colouring preferences; the keywords are:
  411.  
  412. MOD : set graphics mode;
  413. ASP : correct aspect ratio;
  414. GRC : set grid colour;
  415. BRC : set border colour;
  416. BGC : set background colour.
  417. PAL : set one colour in the palette used;
  418. PRN : number of printer port;
  419. OVP : number of overprintings for hardcopies.
  420.  
  421. This  stands  in  need  of  some  clarification.   To start with, your
  422. graphics  adapter  may  support  various  graphics  modes:    Hercules
  423. doesn't, but,  e.g., EGA  does.   MapView always  chooses the  highest
  424. resolution by itself; if you don't  like that, you can change it  here
  425. by including a line starting with 'MOD', then the number of a graphics
  426. mode to your liking.  Try it out - you can't break anything.  - ASP is
  427. the only parameter that accepts a real argument; if a full globe comes
  428. out  distorted  on  your  screen,  you  can  correct this by giving an
  429. adjustment factor  here which  sizes in  horizontal direction  will be
  430. multiplied by.
  431.  
  432. GRC, BRC, and BGC choose colours out of the current colour palette for
  433. their  respective  purposes;  this  won't  help  you  with  monochrome
  434. adapters, but otherwise,  experiment to find  out what you  like best.
  435. Two special features are involved:  a colour of 99 will always be  the
  436. highest colour  available, i.e.,  in general,  white; negative  values
  437. (for grid and border only) will draw those lines as dotted ones.  This
  438. is mainly useful on monochrome  boards to distinguish grid lines  from
  439. serious stuff; so that's the default.  Otherwise, this feature is  not
  440. much  good  on  monochrome  adapters  or  screens.    - Again, invalid
  441. arguments will be ignored.   - PAL allows  you to change colours  in a
  442. palette on adapters  that support this  feature.  You'll  have to give
  443. two integer values on a PAL line:  the first is the number of the slot
  444. within the  palette, the  second is  the number  of the  colour.   For
  445. details, refer to your graphics adapter's or computer's manual.
  446.  
  447. Now for the printer support:  usually, MapView uses printer port 1 for
  448. hardcopies.  If  you have connected  your printer through  a different
  449. port, you may specify that number on a PRN line.  The range  supported
  450. is 1 through 4. Finally, OVP allows you to select the number of  times
  451. the  print  head  moves  over  each  line  of  graphics  output   when
  452. hardcopying.    Overprinting  makes  the  lines  look blacker; but, of
  453. course, it takes some time.  The number may be in the range from 1  to
  454. 5;  the  default  is  1,  which  will  suffice in many cases; 2 should
  455. definitely be enough.  Of course,  all this makes only sense for  real
  456. matrix printers.
  457.  
  458. Again, lines starting with a ';' are treated as comment lines.
  459.  
  460.  
  461. (vi) Slide and QSlide operation
  462. -------------------------------
  463.  
  464. Once you have created a picture file, you may want to review it later;
  465. after all, that's presumably why you made it.  For this purpose, Slide
  466. and  QSlide  are  provided.    They  are  very simple, non-interactive
  467. programmes that  read a  picture file  and display  the pictures in it
  468. sequentially.  At start-up, you may tell them to introduce a delay  of
  469. so-and-so-many milliseconds between each  two pictures, and to  repeat
  470. the whole sequence so-and-so-often, where 'so-and-so-...' is between 0
  471. and 65535.  A repeat count of 0 will repeat indefinitely; a delay time
  472. of 0 will give  a special maximum delay  of some 11 minutes.   You may
  473. abort operation at any time by pressing any key.
  474.  
  475. There is an additional optional  switch, the keypress switch:   if you
  476. specify "/K" on the command line,  pressing a key will not in  general
  477. quit the programmes but rather immediately switch to the next picture.
  478. This is handy for semi-automated slide shows:  call Slide (or  QSlide)
  479. with a  delay of,  say, 10000  milliseconds (or  maybe even choose the
  480. extra long delay time as explained above), and hit any key as soon  as
  481. you are fed up with one  particular picture.  The keys "Q",  "ESC" and
  482. "Ctrl-C" may still be used to quit the programme, however.
  483.  
  484. The first time through, Slide will  try to read all the pictures  into
  485. memory and display them from there later on, when you have specified a
  486. repeat count greater than 1. If they don't fit, Slide will continue to
  487. read pictures from  disk repeatedly.   If you have  a graphics adapter
  488. with at least two pages, it will  do very smooth swapping.  If, or  as
  489. long  as,  it  has  to  read  from  disk,  the display rate is about 2
  490. pictures per second; if it takes them from memory, the rate is about 3
  491. per second.  (These  times are for a  10MHz AT and a  28ms hard disk.)
  492. On a 640k PC with no memory hogs installed, about 17 Hercules  screens
  493. can be held in  memory; this figure will  be much less for  EGA or VGA
  494. screens, of course. If you have one of these adapters, you may want to
  495. use some form of CGA or Hercules emulation for slide shows.
  496.  
  497. If all the pictures in a file fit into memory at once, you may want to
  498. use QSlide instead of Slide.  Picture swapping is not so smooth  while
  499. reading from disk; but once that is done, QSlide will be  rocket-fast:
  500. you'll get more than 15 screens per second (on a 10MHz AT).  This will
  501. only work on CGA or  Hercules adapters due to size  limitations; sorry
  502. for this - blame the 80x86 segment structure.  - Due to the  different
  503. screen  storage  management,  there  may  be  slightly  less  room for
  504. pictures; e.g., with 580KB free memory, I can fit 17 Hercules  screens
  505. into Slide, but only 16 into QSlide.  Have a try.
  506.  
  507. There  are  two  example  command  files  for  MapView, GRID16.CMD and
  508. WORLD16.CMD, which produce files for use with Slide and QSlide;  these
  509. are designed with the Hercules user in mind.  You can take these as  a
  510. starting point to making your own.
  511.  
  512. Both programmes check if the picture file was produced for the display
  513. adapter you are using; if not, they tell you so and quit.
  514.  
  515. Call Slide from the DOS command line via
  516.            slide  <filename> [/R<repeatcount>] [/D<delay>] [/K]
  517. or QSlide via
  518.            qslide <filename> [/R<repeatcount>] [/D<delay>] [/K]
  519.  
  520. (with no  blanks except  where indicated).   The  default extension is
  521. .PIC.    Note  that  both  programmes  will  not  search  any paths by
  522. themselves; so if  you have made  up a separate  picture directory, be
  523. sure to include its name with the file name.
  524.  
  525.  
  526. (vii) Map files
  527. ---------------
  528.  
  529. MapView  is  made  around  the  world  map  files  provided by Mr John
  530. Allison, The World Digitized, Apollo, PA.  These files are not part of
  531. the MapView package but may be obtained at various bulletin boards and
  532. shareware servers.  Please, heed his  request for a $20 donation.   He
  533. has  also  supplied  good  documentation  of  the  data  and discusses
  534. strengths and weaknesses.
  535.  
  536. MapView can read  three different file  formats.  The  basic format is
  537. the  MP1  format,  as  supplied  by  Mr Allison; these files are plain
  538. ASCII.  From these files, MP2  and MP3 files are derived, which  store
  539. latitude, longitude, Mercator equivalent of latitude, and  precomputed
  540. three-dimensional  Cartesian  coordinates  in  binary  format;  MP2 is
  541. mainly  for  non-80x87  machines,  whereas  MP3  is  designed  to take
  542. advantage of a math-coprocessor and is also slightly more compact (cf.
  543. appendix  C  below).    Both  these  formats allow for fastest MapView
  544. execution but takes up even  more space on your disk.   Alternatively,
  545. you may use MP0 files, which are binary integer values; these are  the
  546. most compact format, still somewhat faster to process than MP1  files,
  547. but by far  slower than MP2  and MP3 files.   Also, there  is a slight
  548. decrease  in  exactness;  unless  you  zoom  way down, this should not
  549. result in inaccuracies of more than one pixel.
  550.  
  551. There is  another advantage  to using  MP2, MP3  or MP0  files:  these
  552. include  quick-scan  information  on  which  region  of the Earth they
  553. pertain to.   What  good is  this?   Well, suppose  you have  only MP1
  554. files,  and  suppose  further  you  have  displayed a map of the whole
  555. world,  and  now  zoom  down  to  some comparatively small region, say
  556. Australia.  If you forget to switch to an appropriate list file (e.g.,
  557. AU2), MapView will  try to display  each of the  world map files:   no
  558. harm done, but you will be kept waiting for a long time while  MapView
  559. tries to plot all those lines outside of Australia.  With MP0, MP2, or
  560. MP3 files,  however, MapView  can quickly  determine if  a certain map
  561. file should be considered for plotting  at all, and you'll be done  in
  562. almost the same  time as if  you had specified  the correct subset  of
  563. maps.  (In fact, this feature practically removes the need for most of
  564. the list files, except LEV0 through LEV3 - whichever region you choose
  565. to display, just select one of  the LEV files according to the  amount
  566. of information you want.)  Of course, you don't have to have more than
  567. one format on disk; pick your choice - space or speed.
  568.  
  569. For drawing, if you haven't specified an extension for a file to  draw
  570. (usually in the list file you are plotting), MapView will try to  find
  571. a map file with extension .MP2 (in the current directory or any of the
  572. subdirectories specified on an  MPX line in your  configuration file);
  573. if you have recompiled MapView  to make use of a  coprocessor, MapView
  574. will look for extension .MP3 instead.  If it finds none, it will try a
  575. MP0 file, and, as a last resort, a MP1 file.
  576.  
  577. To  produce  MP2,  MP3,  or  MP0  files  from an MP file, you can call
  578. Mp1ToMpX from the DOS prompt via
  579.  
  580.            MP1TOMPX <filename> [/0 | /2 | /3]
  581.  
  582. where the file name must include  its extension MP1. The file must  be
  583. in the current directory or include a path, and the resulting file  is
  584. written to  the current  directory.   - Alternatively,  if you want to
  585. process a  group of  files, prepare  a text  file containing the fully
  586. qualified file names (no extension) of all the files in the group; the
  587. extension must be LST.  In fact, you can use such a file later on as a
  588. list  file;  or  you  can  use  the  list  files distributed with this
  589. package.  Then call Mp1ToMpX from the DOS prompt via
  590.  
  591.            MP1TOMPX <listfilename> [/0 | /2 | /3]
  592.  
  593. Again, the file name must include its extension LST, and a path may be
  594. specified.
  595.  
  596. /0 will produce MP0 files, /2 will produce MP2 files, etc.; /2 is  the
  597. default.  - Note  that MP1TOMPX expects all  MP1 files in the  current
  598. directory, unless  specified otherwise.   -  Hence, to  convert to MP2
  599. format the whole bunch of MP1  files as supplied by Mr Allison,  group
  600. them all together in a single directory; put the file LEV3.LST  there,
  601. too, and type
  602.  
  603.            MP1TOMPX LEV3.LST
  604.  
  605. This process will take about 45 minutes on a 10MHz AT with a 28ms hard
  606. disk, time well spent.  Producing MP0 files is much faster, of course.
  607. - Note that you need not concern yourself with the details of all this
  608. if you  use INSTMAP.BAT  included with  the MapView  package (see (ii)
  609. above).
  610.  
  611. One more  note:   the binary  formats are  not very  archive-friendly,
  612. i.e.,  they   don't  compress   well  under   the  common  compression
  613. algorithms,  while  MP1  files  do.    If  you  want  to  store   away
  614. full-precision data  for later  whatever-you-like-to-do-to-data, you'd
  615. better use the original MP1 files; they take up much less space (after
  616. compression) than MP2 files, and you don't give away precision as  you
  617. would with MP0 data, which, after compression, are still smaller  than
  618. the compressed MP1 data.
  619.  
  620.  
  621. (viii) Trigonometric values file
  622. --------------------------------
  623.  
  624. For  fastest  MapView  execution,  you  may  produce a file that holds
  625. precomputed trigonometric values as used by MapView.  If MapView finds
  626. this file  in the  current directory  at start-up  and you have enough
  627. free memory, it will read this file and execute faster (at the expense
  628. of a slight loss of accuracy - but that should not result in errors of
  629. more than one pixel, except  at very high magnifications); if  it does
  630. not find the  file, that's fine  with MapView, too.   In general,  the
  631. file produced will be called TRIG2.BIN, which is designed for use with
  632. MapView as distributed.  If, however, you decide to recompile  MapView
  633. for use with an  80x87, specify "/3" as  a command line parameter  for
  634. TrigCalc.   This will  produce a  file called  TRIG3.BIN.   - You will
  635. notice the speed gain  particularly if you use  MP0 or MP1 files;  see
  636. the timings in appendix C below.
  637.  
  638. To make the file, just run  TRIGCALC.EXE - that's it.  You  won't need
  639. the EXE  file any  more, so  you may  remove it  from your  hard disk.
  640. (Remember to say "TRIGCALC /3" instead if you have recompiled  MapView
  641. for 80x87 use.)
  642.  
  643.  
  644. (xi) History
  645. ------------
  646.  
  647. Version 1.0  Original programme by Ton van den Bogert
  648.              <WWDONIC@HEITUE5.BITNET>, written in TurboPascal 3.01 for
  649.              Hercules graphics adapter.
  650.  
  651.         2.0  Converted to TurboPascal 5.0 by Gisbert W.Selke
  652.              <RECK@DBNUAMA1.BITNET>. Removed (hopefully) all Hercules
  653.              specifics. Now handling orthographic projection properly
  654.              in all cases. Added Lambert projection. Re-arranged code.
  655.              Added bells and whistles. Changed command interface
  656.              slightly. Added support for MP0, MP1 and MP3 file formats.
  657.              Added configurability. Generalized picture file format.
  658.              Added compiler switches for easy recompilation on 80x87
  659.              systems. Supplied new picture file viewers and file
  660.              preprocessors. See separate upgrade notice if you have
  661.              old command files. - Released 12 Jan 1989.
  662.  
  663.  
  664. (x) Bugs, limitations, future enhancements
  665. ------------------------------------------
  666.  
  667. If a map extends beyond the window specified, the connections  between
  668. points just barely within the window and their outside neighbours  are
  669. not displayed.  I don't think this is a serious limitation.
  670.  
  671. Support for other types of printers may become available.
  672.  
  673. More projection methods may be added.
  674.  
  675. I haven't tested the colour features, nor have I tested either MapView
  676. or Slide on anything but  a Hercules graphics adapter.   This includes
  677. Slide and QSlide.  I hope all works as advertised.
  678.  
  679. MapView currently does not allow small areas on the 'back side of  the
  680. Earth' to be viewed, e.g., from 170° West to 170° East.  Some day I'll
  681. add this 'wrap-around' feature.
  682.  
  683. MapView will not run on very  small systems; it is designed for  speed
  684. (I/O buffering and the ilk), not for memory size.  But then again, who
  685. has a 128k machine.
  686.  
  687.  
  688. Bugs? I'd like to hear about them. Get in touch with me at
  689.  
  690. TapirSoft
  691. Gisbert W.Selke            <RECK@DBNUAMA1.BITNET>
  692. Ermekeilstrasse 28
  693. D-5300 Bonn 1
  694. West Germany
  695.  
  696.  
  697.  
  698.  
  699. Appendix A
  700. ----------
  701.  
  702. This appendix briefly describes the file formats used by MapView.
  703.  
  704. MP0 files
  705.  
  706. These files essentially contain longitude and latitude of map  points.
  707. Both values have to be multiplied  by 0.01 to yield true degrees.   In
  708. addition, if the resulting latitude is greater than 100, 200 has to be
  709. subtracted from  it.   If so,  this indicates  that the  current point
  710. starts  a  new  chain  of  points;  otherwise (i.e., without having to
  711. subtract), the current point is connected to the previous point by  an
  712. approximate straight line (or circle, to be exact).  Each record takes
  713. up 4 bytes.  The first two records are special:  instead of  belonging
  714. to the map data proper, they list the minimum and maximum latitude and
  715. longitude present  in this  file.   The Pascal  record that  describes
  716. these data is (where an integer takes up 2 bytes)
  717.  
  718.            Type mp0rec = Record
  719.                            ilon, ilat : integer;
  720.                          End;
  721.  
  722.  
  723. MP1 files
  724.  
  725. These are the original data as  supplied by Mr Allison.  They  contain
  726. real type latitude and longitude in plain ASCII format; anything after
  727. the second real is junk and  should be disregarded.  An empty  line in
  728. the file indicates that the next point is unconnected to the preceding
  729. one.  Note that the order  of latitude and longitude is reversed  with
  730. respect to MP0 (and MP2) files.
  731.  
  732.  
  733. MP2 files
  734.  
  735. These files contain pre-processed real  data in binary format.   These
  736. real  values  are  6-byte   reals  as  required  by   ordinary  (i.e.,
  737. non-coprocessor) TurboPascal.  The first byte is a flag which, when 0,
  738. indicates that  the current  point is  connected to  the previous one;
  739. otherwise, this point starts a  new outline.  Then come  the longitude
  740. and the  latitude, the  Mercator equivalent  of the  latitude, and the
  741. three-dimensional Cartesian x, y,  z coordinates of the  point, scaled
  742. to be on the surface of the standard unity sphere.  Each record  takes
  743. up 37 bytes.   The first  record in the  file is special:   its record
  744. type is  FFh, and  it lists  the minimum  longitude, minimum latitude,
  745. maximum longitude, maximum latitude present in this file.  The rest of
  746. this record is 0. The Pascal record that describes these data is
  747.  
  748.            Type mp2rec = Record
  749.                            rectyp : byte;
  750.                            lon, lat : real;
  751.                            merclat : real;
  752.                            xg, yg, zg : real;
  753.                          End;
  754.  
  755.  
  756. MP3 files
  757.  
  758. This format is nearly identical  to the preceding one, except  that it
  759. uses  4  byte   reals  (IEEE  single   precision  reals)  instead   of
  760. TurboPascal's  'native'  6  byte  reals.    See  appendix  B  below on
  761. recompilation to make use of this format.  - The only things different
  762. are:  each record takes up  25 bytes, the header record's record  type
  763. is FEh, and the appropriate Pascal record is
  764.  
  765.            Type mp3rec = Record
  766.                            rectyp : byte;
  767.                            lon, lat : single;
  768.                            merclat : single;
  769.                            xg, yg, zg : single;
  770.                          End;
  771.  
  772.  
  773. Picture files
  774.  
  775. Pictures  are  stored  on  disk  in  a simple, uncompressed way, using
  776. variable length records.  For each picture, there is a lead-in  record
  777. of  fixed  length  (12  bytes)  that  contains information on the file
  778. format version, the  number of pictures  to follow to  create a single
  779. screenfull (see below),  the graphics driver  and mode used,  the size
  780. (in bytes) of the picture being described, and its upper left  corner.
  781. The next record contains the image as supplied by the TurboPascal  4.0
  782. GetImage procedure,  i.e., twice  2 bytes  size information,  then the
  783. actual bit map.  Then comes the next picture's lead-in record.  -  See
  784. MAPGRAPH.PAS for  a way  to write  pictures in  this format (procedure
  785. SAVE), or SLIDE.PAS  for a way  how to read  them.  The  Pascal record
  786. that describes the lead-in record is
  787.  
  788.            Type picdesc = Record
  789.                             version, follow : byte;
  790.                             grdriver, grmode : integer;
  791.                             size : word;
  792.                             xmin, ymin : integer;
  793.                           End;
  794.  
  795. To read  the image  data, take  an untyped  pointer variable, allocate
  796. memory as indicated by the size information, and read the next  record
  797. into the memory region thus set aside.
  798.  
  799. The value of FOLLOW is usually 0;  however, the size of an EGA or  VGA
  800. screen exceeds the buffer size  that can be allocated by  TurboPascal.
  801. Hence, these pictures are stored in chunks.  Each chunk is written  to
  802. the file like a complete  picture, header record and all;  each header
  803. record's FOLLOW byte gives the  number of chunks that will  follow the
  804. current one, and it is 0 on the last chunk of a screen.  XMIN and YMIN
  805. specify the region of the screen where each chunk belongs.
  806.  
  807.  
  808. Configuration, command, and list files
  809.  
  810. These files are plain ASCII  files created with any editor  capable of
  811. not writing  special control  sequences to  the file.   Any reasonable
  812. editor should be able to do so; however, some word processors may not.
  813. (You might just  as well cast  those into the  binary garbage bin,  or
  814. /DEV/NUL,  if  you're  a  Un*x  type.)    If need be, use the DOS COPY
  815. command.   Or, horribile  dictu, EDLIN.   -  For particulars,  see the
  816. sections above explaining what these files should contain, and why.  -
  817. There remains one file:   MAPVIEW.HLP.  This file contains  the screen
  818. (or screens) you  get when you  type "?" at  the main MapView  prompt.
  819. You can tailor it to your  own needs, or translate it into  Gaelic, or
  820. even German, if you like.
  821.  
  822.  
  823. Appendix B
  824. ----------
  825.  
  826. A note on recompilation and coprocessor support
  827.  
  828. Since 80x87  math coprocessors  are not  in general  use, MapView,  as
  829. distributed,   is   designed   to   run  on  non-coprocessor  systems.
  830. Everything has been set up  so that recompilation on an  80x87 machine
  831. will  automatically  produce  a  MapView  version  optimized  for  the
  832. additional hardware; there is no need to change the source.  Note that
  833. the coprocessor version cannot read MP2 files (nor TRIG2.BIN); use the
  834. "/3"  switch  for  Mp1ToMpX  and  TrigCalc  to produce the appropriate
  835. formats.  These  latter programmes don't  have to be  recompiled since
  836. they emulate a coprocessor, which is acceptable since they need to  be
  837. run only once.  - If, for  some reason, you do not have a  coprocessor
  838. but want to pretend, you'll have to change the sources of MAPVIEW.PAS,
  839. MAPPROJ.PAS, and  MAPGRAPH.PAS in  one place  each:   replace the "N-"
  840. compiler directives by "N+,E+".
  841.  
  842. Recompilation under TurboPascal 4.0 is also possible; MapView makes no
  843. use of  new features  except the  compiler switch  "A+", which  may be
  844. removed without harm.   The utility  programmes Mp1ToMPX and  TrigCalc
  845. make use  of the  compiler switch  "E+", too;  this can  be removed on
  846. 80x87 systems only.  Otherwise,  all references to the variable  types
  847. SINGLE and EXTENDED have to be removed, too.
  848.  
  849.  
  850.  
  851. Appendix C
  852. ----------
  853.  
  854. MapView Timings
  855.  
  856. This appendix shows you what to expect in performance.  All the  times
  857. given have been taken on an AT clone running at 10MHz, equipped with a
  858. 28ms hard  disk, and  no coprocessor.   FastOpen  had been  installed.
  859. (These times are one-time  measurements, not the results  of carefully
  860. devised series of experiment.)
  861.  
  862. To plot the outlines of continental Europe, E0, without showing grids,
  863. window set to 35°/-10° .. 75°/40°, the times (in seconds) were
  864.  
  865.                                      File format used
  866.                      -- with TRIG2.BIN --     -- without TRIG2.BIN --
  867. Projection type      MP0      MP1      MP2        MP0     MP1     MP2
  868.   None                11       29        8         11      29       8
  869.   Mercator            13       32        8         80      98       9
  870.   Azimuthal           19       35       17         56      72      54
  871.   Orthographic        38       58       26        123     141      34
  872.   Lambert             38       58       34        128     147      62
  873.  
  874.  
  875. Using a coprocessor will  speed things up considerably,  especially if
  876. MapView has been  recompiled and MP3  files (and TRIG3.BIN)  are used;
  877. using TurboPascal 5.0 coprocessor emulation will slow operation down,
  878. of course.
  879.  
  880. Processing the command file WORLD72, i.e., 72 pictures of the Earth in
  881. orthographic projection, viewed from various angles, with  coastlines,
  882. islands, and lakes  (but no political  boundaries), and saving  all 72
  883. images to  disk, took  six and  a half  hours.   A complete set of MP2
  884. files had been generated before; otherwise...
  885.  
  886. As  for  conversion  and  Slide  timings, see the appropriate sections
  887. above.
  888.  
  889.  
  890. Appendix D
  891. ----------
  892.  
  893. General Nonsense and Assorted Rubbish
  894.  
  895. Special thanks go to Ton van den Bogert for the first version of  this
  896. programme, and to Ken van Camp <kvancamp@ARDEC.ARPA> for the precursor
  897. of MP0 files, and his original Swivel programme, which got me started;
  898. they both did extensive testing  of this release and supplied  me with
  899. many valuable hints and  suggestions for improvements; also  to Stefan
  900. Kaufmann  <UNM407@DBNUAMA1.BITNET>  and  Rainer  Kleinrensing  <RAINER
  901. @DBNUAMA1.BITNET>, for important  hints and beta-testing;  Stefan also
  902. improved  Slide  and  suggested  to  me  the algorithm used in QSlide.
  903. Thanks, of course, to John Allison for all the map data.  - Still, all
  904. mistakes are my own, as the saying goes; or blame your CPU.
  905.  
  906. Now for the commercial.
  907.  
  908. There is none.  At least not from  me.  I only ask you to give  credit
  909. where credit is due, and not to give away any of this stuff except  as
  910. a whole.   If you change  anything, please, document  it, and tell  me
  911. about your improvements - I'm interested in them, too!  The  copyright
  912. on all this remains  with Ton van den  Bogert and with me,  though; so
  913. you're not gonna sell any of this.
  914.  
  915. But, on the other hand:
  916.  
  917. We assume no liability, impress or explied, for this programme's being
  918. fit for any particular purpose; the risk is entirely the user's.   You
  919. have been warned.
  920.  
  921. To my best knowledge, no copyrighted material, except where indicated,
  922. is  used  in  this  programme;  however,  nothing  should be taken for
  923. granted.
  924.  
  925. The following registered trademarks /etc/ have been used:
  926.  
  927. TurboPascal, BGI :  Borland International
  928. IBM PC, AT       :  International Business Machines Corporation
  929. MS-DOS           :  MicroSoft Corporation
  930. Unix             :  AT&T
  931. Hercules         :  Hercules Corporation, or whatever they call themselves
  932. WordStar         :  MicroPro International Corporation
  933. Epson            :  Seiko Epson Corporation
  934.  
  935.  
  936. [ End of MAPVIEW.DOC ]
  937.  
  938.